function WeatherCtrl($rootScope, $scope, $sce, log, weather) {
    var self = this;
    $scope.$on('entry', function () {
        $rootScope.$broadcast('startAsync');
        weather.getData().then(function (result) {
            $rootScope.$broadcast('endAsync');
            if (result.status) {
                log.info("Weather result OK");
                var data = result.data.data.query.results.channel;
                data.title = data.title.substr(17);//Note: remove Yahoo prefix

                $scope.weather = data;

                var desc = data.item.description;
                var idx = desc.indexOf('<b>Forecast:</b>');
                desc = desc.substr(0, idx);
                $scope.html = $sce.trustAsHtml(desc);

                $scope.forecasts = data.item.forecast;
            } else {
                log.warn("Weather result error.");
            }
        });
    });
};